//
//  NoteDetailMode.m
//  DogeLegs
//
//  Created by 宋华 on 2017/8/22.
//  Copyright © 2017年 宋华. All rights reserved.
//

#import "NoteDetailMode.h"
#import <objc/runtime.h>

@implementation NoteDetailMode

- (id)initWithNoteMode:(NoteMode *)mode {
    if (self = [super init]) {
        unsigned int count = 0;

        Ivar *ivarLists = class_copyIvarList([NoteMode class], &count);
        for (int i = 0; i < count; i++) {
            const char* name = ivar_getName(ivarLists[i]);
            NSString* strName = [NSString stringWithCString:name encoding:NSUTF8StringEncoding];
            NSString *value =  [mode valueForKey:strName];
            [self setValue:value forKey:strName];
        }
        free(ivarLists);
    }
    return self;
}



@end
